package net.zjitc.controller;


import net.zjitc.pojo.Goods;
import net.zjitc.pojo.GoodsAlbum;
import net.zjitc.service.GoodsAlbumService;
import net.zjitc.utils.APIResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author:xuying
 * @date:2024/12/29 15:44:41
 */

@RestController
@RequestMapping("/goodsAlbum")
public class GoodsAlbumController {
   @Autowired
   private GoodsAlbumService goodsAlbumService;
    @GetMapping("/list")
    public APIResponse<List<GoodsAlbum>> getGoodsAlbumListById(Integer id){
        List<GoodsAlbum> goodsAlbumList = goodsAlbumService.getGoodsAlbumListById(id);
        return APIResponse.suc("成功",goodsAlbumList);
    }
    @PostMapping("/update")
    public APIResponse<String> updateGoodsAlbum(@RequestBody List<GoodsAlbum> goodsAlbum){

        goodsAlbumService.updateGoodsAlbum(goodsAlbum);
        return APIResponse.suc("成功",null);
    }
}
